package com.maojianjie.aimee.utils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class RegexUtil
{
	public static String find(String targetStr, String patternStr)
	{
		Pattern pattern = Pattern.compile(patternStr);
		Matcher matcher = pattern.matcher(targetStr);
		if (matcher.find())
		{
			return matcher.group(1);
		}
		return null;
	}

	public static Boolean matches(String targetStr, String patternStr)
	{
		Pattern pattern = Pattern.compile(patternStr);
		Matcher matcher = pattern.matcher(targetStr);
		return matcher.matches();
	}
}